import Vue from "vue";
import App from "./App.vue";
import router from "./router";
import store from "./store";
import ElementUI from "element-ui";
import vueAxios from "vue-axios";
import axios from "axios";
import VueCookies from "vue-cookies";
import "element-ui/lib/theme-chalk/index.css";
import myrequire from "@/assets/js/require";
import wl from "wl-vue-select";
import { selectDictLabel } from "../src/assets/js/utlis";
import md5 from "js-md5";
import { message } from "./assets/js/resetMessage";
import $ from "jquery";
import "../src/assets/js/lastTime";
import "../src/assets/js/validation";

//导入reset css样式
import "../src/assets/style/reset.css";
import "../src/assets/style/result.css";
// import "../src/assets/style/media.css";
Vue.use(wl);
Vue.config.productionTip = false;
Vue.use(ElementUI);
Vue.use(vueAxios, axios);
Vue.use(VueCookies);
Vue.use(myrequire);
Vue.prototype.$md5 = md5;
Vue.prototype.selectDictLabel = selectDictLabel;

Vue.prototype.$message = message; //重写message提示框  一定要放在Vue.use(ElementUI)之后
Vue.prototype.$ = $;

//全局防抖
Vue.directive("noMoreClick", {
  inserted(el) {
    el.addEventListener("click", () => {
      el.classList.add("is-disabled");
      el.disabled = true;
      setTimeout(() => {
        el.disabled = false;
        el.classList.remove("is-disabled");
      }, 3000);
    });
  }
});

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount("#app");
